<template>
  <div class="bianji">
    <van-address-edit
      :area-list="areaList"
      show-delete
      show-set-default
      show-search-result
      :search-result="searchResult"
      :area-columns-placeholder="['请选择', '请选择', '请选择']"
      @save="onSave"
      @delete="onDelete"
      @change-detail="onChangeDetail"
    />
  </div>
</template>
<script>
import { Toast } from 'vant';
import { areaList } from '@vant/area-data';
import axios from "axios"
export default {
  data() {
    return {
      name: "lizheng",
      areaList,
      value: [],
      searchResult: [],
      token: localStorage.token
    };
  },
  methods: {
    async postbianji(token) {
      await axios.post("https://api.java.crmeb.net/api/front/address/edit", {
        Headers: {
          "Content-Type": token
        },
        data: {

        }
      })
    },
    onSave() {
      Toast('save');
     console.log(item);
  
    },
    onDelete() {
      Toast('delete');
    },
    onChangeDetail(val) {
      if (val) {
        this.searchResult = [
          {
            name: this.name,
            address: this.addressDetail,
          },
        ];
      } else {
        this.searchResult = [];
      }
    },
  },
};
</script>
<style lang="scss" scoped>
</style>